package xyz.bali16.module.advise.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gitee.starblues.annotation.Supplier;
import xyz.bali16.module.advise.entity.Advise;
import xyz.bali16.module.advise.model.AdviseAddParam;
import xyz.bali16.module.advise.model.AdvisePageParam;


/**
 * @author bali2 on 27/2/2022.
 * @version 1.0
 */
@Supplier("advise")
public interface AdviseService extends IService<Advise> {

    /**
     * 根据留言目标（类别、id）对留言进行分页查询
     * @param parentType
     * @param parentId
     * @return
     */
    IPage<Advise> getPage(AdvisePageParam param);


    /**
     * 查询留言的数量
     * @param parentId
     * @return
     */
     Integer getAdviseCount(String parentId);


    /**
     * 添加留言（需要事务管理）
     * @param param
     * @return
     */
    void addAdvise(AdviseAddParam param) throws Exception;

    void delete(String adviseId) throws Exception;

    @Supplier.Method("getYesterdayCount")
    Integer getYesterdayCount();

    @Supplier.Method("countAdvise")
    Integer countAdvise();

}
